<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'contactTeam.label', default: 'ContactTeam')}"/>
    <title>编辑团队联系人</title>
</head>

<body>
<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>Next CRM</li>
                    <li><g:link controller="contact" action="show"
                                id="${this.contactTeam?.contact?.id}">${this.contactTeam?.contact?.fullName}</g:link></li>
                    <li class="active">
                        <span>编辑团队联系人</span>
                    </li>
                </ol>
            </div>

            <h2 class="font-light m-b-xs">
                编辑团队联系人
            </h2>
        </div>
    </div>
</div>

<div class="content animate-panel">
    <div class="row">
        <g:if test="${flash.message}">
            <div class="message" role="status">${flash.message}</div>
        </g:if>
        <g:hasErrors bean="${this.contactTeam}">
            <ul class="errors" role="alert">
                <g:eachError bean="${this.contactTeam}" var="error">
                    <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message
                            error="${error}"/></li>
                </g:eachError>
            </ul>
        </g:hasErrors>
        <div class="hpanel hyellow">
            <div class="panel-heading">
                编辑团队联系人
            </div>

            <div class="panel-body">

                <g:form resource="${this.contactTeam}" method="PUT" class="form-horizontal">
                    <div class="form-group row">
                        <label class="col-md-2  col-form-label is-required">名称</label>

                        <div class="col-md-3">
                            <input class="form-control" type="hidden" name="contact.id"
                                   value="${this.contactTeam?.contact?.id}">
                            <g:select class="form-control" name="user.id" optionKey="id"
                                      from="${this.userList}" value="${this.contactTeam?.user?.id}"
                                      noSelection="${['': '请选择']}"></g:select>
                        </div>

                        <label class="col-md-2  col-form-label is-required">权限</label>

                        <div class="col-md-3">
                            <g:select class="form-control" name="teamRole.id" optionKey="id"
                                      optionValue="name"
                                      from="${com.next.TeamRole.list()}" value="${this.contactTeam?.teamRole?.id}"
                                      noSelection="${['': '请选择']}"></g:select>
                        </div>
                    </div>

                    

                    <div class="form-group row">
                        <label class="col-md-2  col-form-label">联系人权限</label>

                        <div class="col-md-3">
                            <g:select class="form-control" name="contactPermission.id" optionKey="id" optionValue="name"
                                      from="${com.next.TeamRole.list()}"
                                      value="${this.contactTeam?.contactPermission?.id}"
                                      noSelection="${['': '请选择']}"></g:select>
                        </div>

                        <label class="col-md-2  col-form-label">活动权限</label>

                        <div class="col-md-3">
                            <g:select class="form-control" name="activityPermission.id" optionKey="id"
                                      optionValue="name"
                                      from="${com.next.TeamRole.list()}"
                                      value="${this.contactTeam?.activityPermission?.id}"
                                      noSelection="${['': '请选择']}"></g:select>
                        </div>
                    </div>

                    

                    <div class="form-group row">
                        <label class="col-md-2  col-form-label">团队权限</label>

                        <div class="col-md-3">
                            <g:select class="form-control" name="teamPermission.id" optionKey="id" optionValue="name"
                                      from="${com.next.TeamRole.list()}" value="${this.contactTeam?.teamPermission?.id}"
                                      noSelection="${['': '请选择']}"></g:select>
                        </div>

                        <label class="col-md-2  col-form-label">附件权限</label>

                        <div class="col-md-3">
                            <g:select class="form-control" name="attachmentPermission.id" optionKey="id"
                                      optionValue="name"
                                      from="${com.next.TeamRole.list()}"
                                      value="${this.contactTeam?.attachmentPermission?.id}"
                                      noSelection="${['': '请选择']}"></g:select>
                        </div>
                    </div>

                    

                    <div class="form-group row">
                        <label class="col-md-2  col-form-label">笔记权限</label>

                        <div class="col-md-3">
                            <g:select class="form-control" name="notePermission.id" optionKey="id" optionValue="name"
                                      from="${com.next.TeamRole.list()}" value="${this.contactTeam?.notePermission?.id}"
                                      noSelection="${['': '请选择']}"></g:select>
                        </div>

                        <label class="col-md-2  col-form-label">定制字段权限</label>

                        <div class="col-md-3">
                            <g:select class="form-control" name="flexFieldPermission.id" optionKey="id"
                                      optionValue="name"
                                      from="${com.next.TeamRole.list()}"
                                      value="${this.contactTeam?.flexFieldPermission?.id}"
                                      noSelection="${['': '请选择']}"></g:select>
                        </div>
                    </div>

                    

                    <div class="form-group row">
                        <label class="col-md-2  col-form-label">地址权限</label>

                        <div class="col-md-3">
                            <g:select class="form-control" name="addressPermission.id" optionKey="id" optionValue="name"
                                      from="${com.next.TeamRole.list()}"
                                      value="${this.contactTeam?.addressPermission?.id}"
                                      noSelection="${['': '请选择']}"></g:select>
                        </div>
                    </div>

                    

                    <div class="form-group row">
                        <div class="col-md-7">
                            <g:submitButton class="btn btn-info" name="create" value="保存"/>
                        </div>
                    </div>
                </g:form>
            </div>
        </div>
    </div>
</div>
</body>
</html>
